#ifndef __JOYPAD_H
#define __JOYPAD_H
#include "STC15F2K60S2.h"

sbit JOY_CLK=P1^5;
sbit JOY_LAT=P1^6;
sbit JOY_DAT=P1^7;

#define GAME_A      0x7f
#define GAME_B      0xbf
#define GAME_SELECT 0xdf
#define GAME_START  0xef
#define GAME_UP     0xf7
#define GAME_DOWN   0xfb
#define GAME_LEFT   0xfd
#define GAME_RIGHT  0xfe

#define GAME_KEY_C	0xdf
#define GAME_KEY_D  0x7f
#define GAME_KEY_E	0xbf
#define GAME_KEY_B	0xef

unsigned char JOYPAD_NUM(void);
unsigned char JOYPAD_GAME_KEY(unsigned char keynum);

#endif
